using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AnQinFrameWorkAPI.Entity.Finance.Entity;

/// <summary>
///     财务用户登录记录表
/// </summary>
[Table("FinanceUserLoginRecord")]
public class FinanceUserLoginRecord
{
    #region 字段

    /// <summary>
    ///     id
    /// </summary>
    [Key]
    [MaxLength(36)]
    public Guid Id { get; set; }

    /// <summary>
    ///     用户id
    /// </summary>
    [MaxLength(36)]
    public Guid FinanceUserId { get; set; }

    /// <summary>
    ///     登录IP
    /// </summary>
    [MaxLength(50)]
    public string? LoginIP { get; set; }

    /// <summary>
    ///     登录时间
    /// </summary>
    public DateTime LoginTime { get; set; }

    /// <summary>
    ///     登录状态（成功/失败）
    /// </summary>
    public bool IsSuccess { get; set; }

    /// <summary>
    ///     备注（如登录失败原因）
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    ///     登录设备信息
    /// </summary>
    [MaxLength(200)]
    public string? DeviceInfo { get; set; }

    #endregion

    #region 关联

    /// <summary>
    ///     财务用户
    /// </summary>
    public virtual FinanceUserModel FinanceUser { get; set; }

    #endregion
}